package com.albaba.designpattern.command.text_001;

/**
 * @Description: TODO
 * @Author zx
 * @Date 2025/2/27 17:13
 * @Version 1.0
 */
public class Client {

    public static void main(String[] args) {

        Order order = new Order();
        order.setDiningTable(10);
        order.getFoodMenu().put("西红柿鸡蛋面", 1);
        order.getFoodMenu().put("红烧肉", 1);


        Order order1 = new Order();
        order1.setDiningTable(12);
        order1.getFoodMenu().put("红烧肉", 1);
        order1.getFoodMenu().put("西红柿鸡蛋面", 1);
        order1.getFoodMenu().put("鱼香肉丝", 1);
        order1.getFoodMenu().put("宫保鸡丁", 1);

        // 创建接受者
        Chef chef = new Chef();
        // 将订单和接受者封装成命令对象
        OrderCommand orderCommand = new OrderCommand(chef, order);
        OrderCommand orderCommand1 = new OrderCommand(chef, order1);

        // 创建调用者
        Waiter waiter = new Waiter();
        waiter.setCommands(orderCommand);
        waiter.setCommands(orderCommand1);

        // 调用者发出命令
        waiter.orderUp();

    }
}
